if (operation1() and
    ##|operation2()##|):
    print("success!")

##r

extracted_variable = operation2()
if (operation1() and
    extracted_variable):
    print("success!")
